package com.woniu.command.customerTypeCommand;

import com.woniu.command.Command;
import com.woniu.command.handler.CustomerTypeCommandHandler;
import com.woniu.utils.ApplicationContextHolder;

public class DeleteCustomerTypeCommand implements Command<Long,Integer> {

    private CustomerTypeCommandHandler handler;
    public DeleteCustomerTypeCommand(){
        this.handler = ApplicationContextHolder.getApplicationContext()
                .getBean(CustomerTypeCommandHandler.class);
    }
    @Override
    public Integer  execute(Long id) {
        return handler.deleteCustomerTypeById(id);
    }
}
